﻿using System.ComponentModel.Composition;
using Reactor.Configuration;
using Reactor.Environment;
using Reactor.ServiceGrid;

namespace Reactor.Services.PulseService
{
    [Export(typeof(ICustomizeReactorInitialization))]
    public class Initializer : ICustomizeReactorInitialization
    {
        #region Implementation of ICustomizeReactorInitialization

        /// <summary>
        /// Gets the execution order for this initializer. The lower the value, the earlier it will 
        /// be executed in a chain of initializers.
        /// </summary>
        /// <value>The execution order.</value>
        public uint ExecutionOrder
        {
            get { return 5; }
        }

        /// <summary>
        /// Initializes Reactor by providing an <seealso cref="IReactorService"/> instance to represent the current service.
        /// </summary>
        public void InitializeReactor()
        {
            Context.GridContext.CurrentReactorService = new PulseService();
        }

        #endregion
    }
}
